package cn.smxy.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("plant")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Plant implements Serializable {
    private static final long serialVersionUID = 903545068172667377L;

    @TableId(type = IdType.ASSIGN_ID,value = "plant_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long plantId;

    private String plantName;

    private String plantSpecific;

    private String latinName;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long categoryId;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long familyId;

    private String plantDescription;

    private String address;

    private String plantPicture;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId; // 管理员添加时userId为0

    private Long createTime;

    private Integer isChoiceness; // 0表示未被官方认证，1表示官方认证
}
